package com.mpastruct.test.convertor;

import com.mpastruct.test.dto.PersonDTO;
import com.mpastruct.test.entities.PersonDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author liuziyang
 * @Create 2020/8/15 17:32
 * @Description
 */
@Mapper
public interface PersonConverter {
    PersonConverter INSTANCE = Mappers.getMapper(PersonConverter.class);

    @Mappings(@Mapping(source = "name", target = "userName"))
    PersonDTO do2dto(PersonDO person);

}
